<?php

declare(strict_types=1);

namespace App\CustHub\Constants;

use App\Common\Constants\AbstractBaseConstants;
use Hyperf\Constants\Annotation\Constants;

/**
 * 中控群监听内容
 */
#[Constants]
class CtrlRoomListeningContentConstants extends AbstractBaseConstants
{
    /**
     * @Message("文本")
     */
    public const TEXT = 0;

    /**
     * @Message("图片")
     */
    public const IMAGE = 1;

    /**
     * @Message("表情包")
     */
    public const EXPRESSION = 2;

    /**
     * @Message("视频")
     */
    public const VIDEO = 3;

    /**
     * @Message("小程序")
     */
    public const MINI_PROGRAM = 4;

    /**
     * @Message("链接")
     */
    public const URL = 5;

    /**
     * @Message("视频号")
     */
    public const VIDEO_CHANNEL = 6;

    /**
     * @Message("聊天合集")
     */
    public const CHAT_COLLECTION = 7;

    /**
     * @Message("红包")
     */
    public const RED_PACKET = 8;


    public static function getListeningContent(int $type): int
    {
        return match ($type) {
            0,2 => self::TEXT,
            14,101 => self::IMAGE,
            29,104 => self::EXPRESSION,
            23,103 => self::VIDEO,
            78 => self::MINI_PROGRAM,
            13 => self::URL,
            141 => self::VIDEO_CHANNEL,
            4 => self::CHAT_COLLECTION,
            26 => self::RED_PACKET,
            default => -1,
        };
    }
}